/*
 * @Description: karma执行测试入口配置文件
 * @Author: Vergil
 * @Date: 2021-07-13 14:41:43
 * @LastEditTime: 2021-07-20 01:25:39
 * @LastEditors: Please set LastEditors
 */
var webpackConfig = require('../build/webpack.test.js')

module.exports = function (config) {
  config.set({
     // 测试框架
    frameworks: ['mocha', 'sinon-chai'],
    // 测试入口文件
    files: ['**/*.spec.js'],
    // 预处理器 karma-webpack
    preprocessors: {
      '**/*.spec.js': ['webpack', 'sourcemap']
    },
    // Webpack配置
    webpack: webpackConfig,
    // Webpack中间件
    webpackMiddleware: {
      noInfo: true,
    },
    // 测试报告
    reporters: ['spec'],
    // 浏览器
    browsers: ['ChromeHeadless']
  })
}